//
//  BlueToothManager.h
//  UHealth
//
//  Created by liliang on 15/2/3.
//  Copyright (c) 2015年 gjtx. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

typedef void (^LLCentralManagerDiscoverPeripheralsCallback) (NSArray *peripherals,NSArray *advertisementDataArray,NSArray *dateArray);

@interface BlueToothManager : NSObject

@property (nonatomic, getter = isScanning) BOOL scanning;
@property (assign, nonatomic, readonly, getter = isCentralReady) BOOL centralReady;
@property (weak, nonatomic, readonly) NSString *centralNotReadyReason;
@property (weak, nonatomic, readonly) NSArray *peripherals;

//单例
+ (BlueToothManager *)sharedManager;

//扫描蓝牙设备
- (void)scanForPeripheralsByInterval:(NSUInteger)aScanInterval
                          completion:(LLCentralManagerDiscoverPeripheralsCallback)aCallback;

//停止扫描
- (void)stopScanForPeripherals;

@end
